<template>
	<view>
		<view class="con">
			<view @click="gotoMore(item)" class="box" v-for="(item,index) in usernameSetData" :key="index">
				<view class="left">
					<view class="text">
						<text>{{item.text}}</text>
					</view>
				</view>
				<view class="right">
					<view class="goMore">
						<image :src="goMoreImg"></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goMoreImg: require('@/static/img/common/goMore.svg'),
				usernameSetData: [{
						id: 1,
						text: '修改密码'
					},
					{
						id: 2,
						text: '忘记密码'
					},
					{
						id: 3,
						text: '账号注销'
					}
				]
			}
		},
		methods: {
			gotoMore(item) {
				if (item.id == 1) {
					return uni.navigateTo({
						url: '/subpkg/main/my/set-up/update-pwd/update-pwd'
					})
				} else if (item.id == 2) {
					return uni.navigateTo({
						url: '/subpkg/main/my/set-up/forget-pwd/forget-pwd'
					})
				} else if (item.id == 3) {
					return uni.navigateTo({
						url: '/subpkg/main/my/set-up/log-off/log-off'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.con {
		width: 100%;
		background-color: #fff;
		margin-bottom: 30rpx;

		.box {
			&:active {
				background-color: #eee;
			}

			width: 92%;
			padding: 0 4%;
			height: 100rpx;
			display: flex;
			justify-content: space-between;


			.left {
				line-height: 100rpx;
				font-size: 28rpx;
				font-weight: 500;
			}

			.right {
				.goMore {
					image {
						width: 40rpx;
						height: 40rpx;
						margin-top: 30rpx;
					}
				}
			}
		}
	}
</style>
